home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15721 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: ix.netcom.com!news
  2. From: philma@ix.netcom.com(Phil Majtan)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Trapping Ctrl-Alt-Del
  5. Date: 20 Apr 1996 22:21:59 GMT
  6. Organization: Netcom
  7. Message-ID: <4lbo27$a8a@dfw-ixnews5.ix.netcom.com>
  8. References: <4kqh5e$fap@ms.slip.net> <4l7n5t$bse@cs3.brookes.ac.uk>
  9. NNTP-Posting-Host: det-mi4-10.ix.netcom.com
  10. X-NETCOM-Date: Sat Apr 20  5:21:59 PM CDT 1996
  11.  
  12. In <4l7n5t$bse@cs3.brookes.ac.uk> Krunchie <95155580@brookes.ac.uk>
  13. writes: 
  14. >
  15. >mavrick@slip.net (Mavrick) wrote:
  16. >>I am running a network of 50 pcs in a class room where students
  17. always
  18. >>manage to bypass the provided computer curriculum program by
  19. rebooting
  20. >>(Ctrl-Alt-Del) their way out, and fool around the hard disks.  Some
  21. >>also found out that Ctrl-C or Ctrl-break would do the same trick.  I
  22. >>need to fine tune the menu program I wrote 2 years ago and  implement
  23. >>a keyboard trapping algorithm to weed out the Ctrl-Alt-Del and Ctrl-C
  24. >>/Ctrl-break.  Any other keys I can easily trap by scanning for their
  25. >>scan codes; however, those 3 combos work differrently. 
  26. >>
  27. >>Could someone write me a short program in C / C++ that would do the
  28. >>trick.  Something as simple as printing 'Hello' every time any of
  29. >>those combos are pressed.  Perhaps I could return the favor by
  30. >>inviting you for lunch should you ever come across the Bay Area
  31. >>(Northern California).  Thank You.  Marvick W C
  32. >>
  33. >>mavrick@slip.net
  34. >>
  35.  
  36. The only way to trap a ctrl-alt-del is to write an interrupt handler
  37. that traps the keyboard interrupt.  You then have to filter out the
  38. keystrokes.  Since this is not easily done in C, I can't really tell
  39. you how to go about doing it.  It's best left up to someone who can do
  40. assembly.
  41. Phil
  42.  
  43.